.center-middle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.position-center {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0);
}

.position-middle {
  position: absolute;
  top: 50%;
  transform: translate(0, -50%);
}

.text-justify {
  overflow: hidden;
  text-align: justify;
  text-align-last: justify;
}

.text-justify:after {
  position: relative;
  display: inline-block;
  content: '';
  width: 100%;
}

.layout-flex {
  display: -webkit-box;
  display: -moz-box;
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flexbox;
  display: flex;
}

@mixin opacity($opacity) {
  opacity: $opacity;
  filter: Alpha(opacity=$opacity * 100);
}

@mixin grayscale($gray) {
  -webkit-filter: grayscale($gray);
  -moz-filter: grayscale($gray);
  -ms-filter: grayscale($gray);
  -o-filter: grayscale($gray);
  filter: grayscale($gray);
  filter: gray;
}

@mixin borderRadius($rad) {
  -webkit-border-radius: $rad;
  -moz-border-radius: $rad;
  -ms-border-radius: $rad;
  -o-border-radius: $rad;
  border-radius: $rad;
}

@function formatPx($px) {
  @if $isMini {
    @return #{$px}rpx;
  }

  @else {
    @return #{$px / 16}rem;
  }
}
